<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Utils - GIAnT API</title>
    <link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="icon" href="../assets/favicon.ico">
    <script src="http://yui.yahooapis.com/combo?3.9.1/build/yui/yui-min.js"></script>
</head>
<body class="yui3-skin-sam">

<div id="doc">
    <div id="hd" class="yui3-g header">
        <div class="yui3-u-3-4">
                <h1><img src="../assets/css/logo.png" title="GIAnT API" width="117" height="52"></h1>
        </div>
        <div class="yui3-u-1-4 version">
            <em>API Docs for: 1.0.0</em>
        </div>
    </div>
    <div id="bd" class="yui3-g">

        <div class="yui3-u-1-4">
            <div id="docs-sidebar" class="sidebar apidocs">
                <div id="api-list">
                    <h2 class="off-left">APIs</h2>
                    <div id="api-tabview" class="tabview">
                        <ul class="tabs">
                            <li><a href="#api-classes">Classes</a></li>
                            <li><a href="#api-modules">Modules</a></li>
                        </ul>
                
                        <div id="api-tabview-filter">
                            <input type="search" id="api-filter" placeholder="Type to filter APIs">
                        </div>
                
                        <div id="api-tabview-panel">
                            <ul id="api-classes" class="apis classes">
                                <li><a href="../classes/Atom.html">Atom</a></li>
                                <li><a href="../classes/Codec.html">Codec</a></li>
                                <li><a href="../classes/Constraints.html">Constraints</a></li>
                                <li><a href="../classes/Database.html">Database</a></li>
                                <li><a href="../classes/Exif.html">Exif</a></li>
                                <li><a href="../classes/Export.html">Export</a></li>
                                <li><a href="../classes/Heatmap.html">Heatmap</a></li>
                                <li><a href="../classes/Server.html">Server</a></li>
                                <li><a href="../classes/Settings.html">Settings</a></li>
                                <li><a href="../classes/Utils.html">Utils</a></li>
                            </ul>
                
                
                            <ul id="api-modules" class="apis modules">
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="yui3-u-3-4">
                <div id="api-options">
                    Show:
                    <label for="api-show-inherited">
                        <input type="checkbox" id="api-show-inherited" checked>
                        Inherited
                    </label>
            
                    <label for="api-show-protected">
                        <input type="checkbox" id="api-show-protected">
                        Protected
                    </label>
            
                    <label for="api-show-private">
                        <input type="checkbox" id="api-show-private">
                        Private
                    </label>
                    <label for="api-show-deprecated">
                        <input type="checkbox" id="api-show-deprecated">
                        Deprecated
                    </label>
            
                </div>
            
            <div class="apidocs">
                <div id="docs-main">
                    <div class="content">
<h1>Utils Class</h1>
<div class="box meta">


        <div class="foundat">
            Defined in: <a href="../files/src_utils.js.html#l1"><code>src\utils.js:1</code></a>
        </div>


</div>


<div class="box intro">
    <p>A collection of utility functions</p>

</div>


<div id="classdocs" class="tabview">
    <ul class="api-class-tabs">
        <li class="api-class-tab index"><a href="#index">Index</a></li>

            <li class="api-class-tab methods"><a href="#methods">Methods</a></li>
    </ul>

    <div>
        <div id="index" class="api-class-tabpanel index">
            <h2 class="off-left">Item Index</h2>

                <div class="index-section methods">
                    <h3>Methods</h3>

                    <ul class="index-list methods">
                            <li class="index-item method">
                                <a href="#method_chain_executor">chain_executor</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_chain_promises">chain_promises</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_hash_of_file_content">hash_of_file_content</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_hash_xml_fragment">hash_xml_fragment</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_remove_image">remove_image</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_token_type_mapping">token_type_mapping</a>

                            </li>
                    </ul>
                </div>



        </div>

            <div id="methods" class="api-class-tabpanel">
                <h2 class="off-left">Methods</h2>

<div id="method_chain_executor" class="method item">
    <h3 class="name"><code>chain_executor</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>funcs</code>
                </li>
                <li class="arg">
                        <code>i</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_utils.js.html#l104"><code>src\utils.js:104</code></a>
        </p>



    </div>

    <div class="description">
        <p>Recursive help method for chain_promises</p>
<ol>
<li>executes a function that returns a promise (no params allowed)</li>
<li>chains itself to the success resolve of the promise</li>
</ol>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">funcs</code>
                        <span class="type">Object</span>


                    <div class="param-description">
                        <p>is an array of functions returning promises</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">i</code>
                        <span class="type">Object</span>


                    <div class="param-description">
                        <p>is the current working index</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_chain_promises" class="method item">
    <h3 class="name"><code>chain_promises</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>funcs</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Promise</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_utils.js.html#l88"><code>src\utils.js:88</code></a>
        </p>



    </div>

    <div class="description">
        <p>chains a list of functions (that return promises) and executes them in the right order
[function() {return Promise.resolve();}, function() {return Promise.resolve();}]</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">funcs</code>
                        <span class="type">Object</span>


                    <div class="param-description">
                        <p>is an array of functions returning promises</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Promise</span>:
            </div>
        </div>


</div>
<div id="method_hash_of_file_content" class="method item">
    <h3 class="name"><code>hash_of_file_content</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>file_path</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">String | Null</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_utils.js.html#l32"><code>src\utils.js:32</code></a>
        </p>



    </div>

    <div class="description">
        <p>SHA1 of the file</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">file_path</code>
                        <span class="type">String</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">String | Null</span>:
            </div>
        </div>


</div>
<div id="method_hash_xml_fragment" class="method item">
    <h3 class="name"><code>hash_xml_fragment</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>fragment_id</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">String | Null</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_utils.js.html#l48"><code>src\utils.js:48</code></a>
        </p>



    </div>

    <div class="description">
        <p>SHA1 of the xml file</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">fragment_id</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">String | Null</span>:
            </div>
        </div>


</div>
<div id="method_remove_image" class="method item">
    <h3 class="name"><code>remove_image</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>file_path</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Number</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_utils.js.html#l59"><code>src\utils.js:59</code></a>
        </p>



    </div>

    <div class="description">
        <p>Delete image from disk</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">file_path</code>
                        <span class="type">String</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Number</span>:
                    <p>return_code</p>

            </div>
        </div>


</div>
<div id="method_token_type_mapping" class="method item">
    <h3 class="name"><code>token_type_mapping</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>token_type</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">String</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_utils.js.html#l70"><code>src\utils.js:70</code></a>
        </p>



    </div>

    <div class="description">
        <p>Differentiates between Token and Group</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">token_type</code>
                        <span class="type">String</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">String</span>:
            </div>
        </div>


</div>
            </div>



    </div>
</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="../assets/js/yui-prettify.js"></script>
<script src="../assets/../api.js"></script>
<script src="../assets/js/api-filter.js"></script>
<script src="../assets/js/api-list.js"></script>
<script src="../assets/js/api-search.js"></script>
<script src="../assets/js/apidocs.js"></script>
</body>
</html>
